package com.zdy.boot.upload.utils;

import java.time.LocalTime;

public class DateUtils {

    public static void main(String[] args) {
        System.out.println(isRange("10:57:25", "03:00"));
    }

    public static boolean isRange(String startTime, String endTime) {
        LocalTime start = LocalTime.parse(startTime);
        LocalTime end = LocalTime.parse(endTime);
        LocalTime now = LocalTime.now();

        if (start.isBefore(end)) {
            return now.isAfter(start) && now.isBefore(end);
        } else {
            return now.isAfter(start) || now.isBefore(end);
        }
    }

}
